<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>


<style>
#content{ min-height:600px;_height:600px;}

.table td{ text-align:right;white-space:nowrap;}
.table .textLeft{ text-align:left;}
.table .count td{ text-align:right;}
.table .count .textCenter { text-align: center;}
.table .member-data-body .textLeft{ text-align:left;}
</style>

</head>
<body style="overflow:auto;">
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：PUSH推送箱</div>
			<div id="topOtherMenu"></div>
		</div>
		<div id="body">
			<div id="search">
				 <form id="searchForm" name="searchForm" method="post" 
            action="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'between'));?>">
				<!-- 时间选择条 -->
				<div id="timeRange">
                 <a  <?php if($this->key=='today'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'today'));?>">今天</a>
					  <a  <?php if($this->key=='yestoday'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'yestoday'));?>">昨天</a>
                  
                    <a  <?php if($this->key=='last-seven-day'):?>
                 class="currentTimeRange"
                 <?php endif;?>  href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-seven-day'));?>">最近7天</a>
                  <a  <?php if($this->key=='last-thirty-day'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-thirty-day'));?>">最近30天</a>
                   <a  <?php if($this->key=='last-three-month'):?>
                 class="currentTimeRange"
                 <?php endif;?> href="<?php echo $this->projectUrl(array('action'=>$this->reportType,'day'=>'last-three-month'));?>">最近三个月</a> &nbsp;
                    <span  <?php if($this->key=='between'):?>
                 class="currentTimeRange"
                 <?php endif;?>
                
                >结束日期选择</span>：<input name="startTime" type="text" class="input" id="startTime" size="10" value="<?php echo $this->vars['startTime'];?>" />
                    <script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script>
-
<input name="endTime" type="text" class="input" id="endTime" size="10" value="<?php echo $this->vars['endTime'];?>" />
<input type="text" name="keyword" id="keyword" value="<?php echo $this->vars['keyword'];?>" />
<input name="searchBtn" type="button" id="searchBtn" value="查找" class="button" />
<br /><br />
操作系统：

<select name="osName" id="osName" style="width:100px;">
  <option value="">操作系统</option>
  <?php foreach($this->osNames as $osName):?>
  <option value="<?php echo $osName;?>" 
<?php if ($this->vars['osName'] == $osName):?>
selected="selected"
<?php endif;?>
><?php echo $osName;?></option>
  <?php endforeach;?>
</select>
版本选择
：
<select name="version" id="version">
<option value="">版本选择</option>
<?php foreach($this->versions as $version):?>
<option value="<?php echo $version;?>" 
<?php if ($this->vars['version'] == $version):?>
selected="selected"
<?php endif;?>
><?php echo $version;?></option>
<?php endforeach;?>
</select>    


<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"endTime","button":"endTime"});</script>
<!-- </div> -->

		 &nbsp; <a name="exportBtn" id="exportBtn" style="background:none; padding-left:0px; padding-top:2px; padding-bottom:2px; text-decoration:none;" >[输出Excel文件]</a>
			  </form>
			</div>
            
            
			<div id="content">
				<div style="display:none;">
<?php foreach($this->rows as $key=>$row) {?>
					<div class="colorbox" style="width:350px;"  id="pushItem<?php echo $row['id'];?>">
						<div class="subject">
							<div class="title"><?php echo $row['name']?>的推送信息</div>
							<div class="close" onClick="$(document).colorbox.close();">&nbsp;</div>
						</div>
						<div>
							<table width="100%" border="0" cellpadding="5" cellspacing="5">
								<tr>
									<td align="right">推送版本：</td><td><?php echo $row['version'];?></td></tr>
									<tr><td align="right">接收平台：</td><td><?php echo $row['osName'];?></td></tr>
									<tr><td align="right">推送开始时间：</td><td><?php echo $row['startTime'];?></td></tr>
									<tr><td align="right">推送结束时间：</td><td><?php echo $row['endTime'];?></td></tr>
									<tr><td align="right">跳转页面：</td><td><?php 
									$ptModel = new Application_Model_PushTask();
									echo $ptModel->getPageName($row['redirPage']);?></td>	</tr>
                                    <tr><td align="right">输入目标编号：</td><td><?php echo $row['targetNum'];?></td>	</tr>
                                    <tr><td align="right">推送信息： </td><td><?php echo $row['msgInfo'];?></td></tr>
                                    
								</tr>

				
							</table>
						</div>
					</div>
<?php
}
?>
				</div>
                <div class="d-title">
                <div  style="clear:both;"></div>
				</div>
				
				<span class="d-line"></span><br/>
			  <form id="listForm" name="listForm" method="post" action="">
           <table class="table" style="width:auto;" >
           <tr class="subject">
             <td>选择</td>
            <td>推送者</td>
           <td width="40%">推送信息</td>
             <td>推送结束日期</td>
             <td>推送平台</td>
           </tr>
           <?php if (is_array($this->rows)):?>
          
            <?php foreach($this->rows as $num=>$row):?>
             <tr>
               <td  class="checkBoxTd"><input type="checkbox" name="selectId[]" id="select0" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
             <td><?php echo $row['name'];?></td>
             <td><a href="javascript:void(0);" onclick="$(document).ready(function(){$.fn.colorbox({inline:true, href:'#pushItem<?php echo $row['id'];?>'});});"><?php echo substr($row['msgInfo'],0,100);?></a></td>
             <td><?php echo $row['endTime'];?></td>
             <td><?php echo $row['osName'];?></td>
             </tr>  
           <?php endforeach;?>
      
                        <tr>
                            <td colspan="3" align="left">
                                <input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
                                <input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
                                <input type="button" name="delete" id="delete" value="删除选中" class="button" onclick="return del();"/>
                            </td>
                             <td align="right" class="paginator" colspan="6">
                             	<?php echo $this->pageString;?>
                             </td>
</tr>
             <?php else:?>
             <tr><td  colspan="21">没有找到任何记录！</td></tr>
             <?php endif;?>
</table>

</form>
			</div>
		</div>
	</div>

<script>
function selData(action,doType){
    $('#searchForm').attr('action', action);
	$('#doType').attr('value', doType);
    $('#searchForm').submit();
}
    $(function(){
		$("#searchBtn").click(function(){
			$("#searchForm").attr("action","<?php echo $this->projectUrl(array('action'=>'push-list','day'=>'between'));?>");
			$("#searchForm").submit();
		})
		$("#exportBtn").click(function(){
			$("#searchForm").attr("action","<?php echo $this->projectUrl(array('action'=>'export-push',
			'startTime'=>$this->vars['startTime'],
			'endTime' => $this->vars['endTime'],
			'osName' => $this->vars['osName'],
			'version'=>$this->vars['version'],
			'keyword'=>$this->vars['keyword']
			));?>");
			$("#searchForm").submit();
		})
	})
</script>
<script language="javascript">
function del()
{
    if (confirm('删除的历史记录不能恢复！')) {
        $("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete', 'backUrl'=>urlencode($this->pageUrl)));?>');
        $("#listForm").submit();
        return true;
    } else {
        return false;
    }
}
</script>


</body>
</html>